package com.myjavalab.core;

import com.myjavalab.util.PrintUtil;

public class ContinueTest {

	private static final int M = 3;
	private static final int N = 4;
	
	public static void main(String[] args) {
		test("");
		test1("1");
		test2("2");
		test3("3");

	}

	public static void test(String s) {
		PrintUtil.prt(s);
		outer: for (int i = 1; i < M; i++) {
			inner: for (int j = 1; j < N; j++) {
				if (j == 2)
					continue outer;
				System.out.println("i = " + i + ", j = " + j);
				// i = 1, j = 1
				// i = 2, j = 1
			}
		}
	}

	public static void test1(String s) {
		PrintUtil.prt(s);
		outer: for (int i = 1; i < M; i++) {
			inner: for (int j = 1; j < N; j++) {
				if (j == 2)
					continue;
				System.out.println("i = " + i + ", j = " + j);
				// i = 1, j = 1; j = 3
				// i = 2, j = 1; j = 3
			}
		}
	}

	public static void test2(String s) {
		PrintUtil.prt(s);
		outer: for (int i = 1; i < M; i++) {
			inner: for (int j = 1; j < N; j++) {
				if (j == 2)
					break;
				System.out.println("i = " + i + ", j = " + j);
				// i = 1, j = 1
				// i = 2, j = 1
			}
		}
	}

	public static void test3(String s) {
		PrintUtil.prt(s);
		outer: for (int i = 1; i < M; i++) {
			inner: for (int j = 1; j < N; j++) {
				if (j == 2)
					continue inner;
				System.out.println("i = " + i + ", j = " + j);
				// i = 1, j = 1; j = 3
				// i = 2, j = 1; j = 3
			}
		}
	}

}
